import 'package:gold/generated/json/base/json_field.dart';
import 'package:gold/generated/json/pool_list_model.g.dart';
import 'dart:convert';
export 'package:gold/generated/json/pool_list_model.g.dart';

@JsonSerializable()
class PoolListModel {
	List<PoolRankModel>? data;
	int? total;
	int? count;
	@JSONField(name: 'per_page')
	int? perPage;
	@JSONField(name: 'current_page')
	int? currentPage;
	@JSONField(name: 'total_pages')
	int? totalPages;

	PoolListModel();

	factory PoolListModel.fromJson(Map<String, dynamic> json) => $PoolListModelFromJson(json);

	Map<String, dynamic> toJson() => $PoolListModelToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class PoolRankModel {
	/// id
	int? id;
	@JSONField(name: 'total_amount')
	/// 总贡献值
	String? totalAmount;
	/// 首次贡献时间
	@JSONField(name: 'created_at')
	String? createdAt;
	/// 上榜时间
	@JSONField(name: 'updated_at')
	String? updatedAt;
	/// 用户id
	@JSONField(name: 'user_id')
	int? userId;
	/// 奖池id
	@JSONField(name: 'pool_id')
	int? poolId;
	/// 计划id
	@JSONField(name: 'plan_id')
	int? planId;
	/// 排名
	int? ranks;
	/// 距离上一名差多少金额
	@JSONField(name: 'diff_amount')
	int? diffAmount;
	/// id
	PoolRankMemberModel? member;
	/// 奖励%
	String? rate;
	/// 奖池最后一名均分:0=否,1=是
	@JSONField(name: 'last_average')
	String? lastAverage;
	/// 最后一名均分人数（0为不限制人数）
	@JSONField(name: 'last_count')
	int? lastCount;

	PoolRankModel();

	factory PoolRankModel.fromJson(Map<String, dynamic> json) => $PoolRankModelFromJson(json);

	Map<String, dynamic> toJson() => $PoolRankModelToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class PoolRankMemberModel {
	/// 用户ID
	int? uid;
	/// 昵称
	String? nickname;
	/// 头像
	String? avatar;

	PoolRankMemberModel();

	factory PoolRankMemberModel.fromJson(Map<String, dynamic> json) => $PoolRankMemberModelFromJson(json);

	Map<String, dynamic> toJson() => $PoolRankMemberModelToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}